package com.tan.springcloud.Controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
public class PayRestTemplate {

    public static final String KEY_URIKER="http://spring-nacos-eureka";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping(value = "/get/tan/{id}")
    public String getPayRestControl(@PathVariable("id")Long id) {
        return restTemplate.getForObject(KEY_URIKER+"/pay/get/"+id,String.class);
    }
}
